package com.yxj04;

import java.io.*;

public class BufferedStreamDemo02 {
    public static void main(String[] args) throws IOException {
//        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\Ccode\\jdata-structure\\ByteStream9\\bw.java"));
//        for(int i = 0; i < 10; i++) {
//            bw.write("hello" + i);
////            bw.write("\t\n");
//            bw.newLine();
//            bw.flush();
//        }

        BufferedReader br = new BufferedReader(new FileReader("D:\\Ccode\\jdata-structure\\ByteStream9\\bw.java"));
//        String line = br.readLine();
//        System.out.println(line);
//
//        line = br.readLine();
//        System.out.println(line);
//
//        line = br.readLine();
//        System.out.println(line);
//
//        line = br.readLine();
//        System.out.println(line);

        //readLin读数据一次读一行，只读内容不读换行符号
        String line;
        while((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();
    }
}
